---
title: Dense Vector Search
---

## Basic Usage

<Note>
  Creating an [HNSW index](/search/dense/index) over a table can significantly
  improve query times.
</Note>

Vectors can be searched using L2 distance, cosine distance, or inner product.

```sql
-- L2 distance
SELECT * FROM mock_items ORDER BY embedding <-> '[1,2,3]'::vector;

-- Cosine distance
SELECT * FROM mock_items ORDER BY embedding <=> '[1,2,3]'::vector;

-- Inner product
SELECT * FROM mock_items ORDER BY embedding <#> '[1,2,3]'::vector;
```

Under the hood, ParadeDB uses `pgvector` for similarity search. Please refer to the
[`pgvector` documentation](https://github.com/pgvector/pgvector) for more details.
